package j06bufferd;

import java.io.*;

public class J1 {
    public static void main(String[] args) throws Exception {
//        BufferedInputStream fs = new BufferedInputStream(
//            new FileInputStream("_0905/src/j06bufferd/1.txt")
//        );
//
//        System.out.println(fs.read());
//        System.out.println((char) fs.read());

        BufferedOutputStream fs = new BufferedOutputStream(
                new FileOutputStream("_0905/src/j06bufferd/1.txt",true)
        );
        fs.write('m');
        fs.write('x');
        fs.flush();
        fs.close();


    }
}

class J2{
    public static void main(String[] args) throws Exception {
        BufferedReader fs = new BufferedReader(
                new FileReader("_0905/src/j06bufferd/1.txt")
        );
        //mx牛魔王mx888mx
//        System.out.println(fs.read());
//        System.out.println(fs.read());
//        System.out.println(fs.read());
//        System.out.println((char) fs.read());
        System.out.println(fs.readLine());
        System.out.println(fs.readLine());
        System.out.println(fs.readLine());
        System.out.println(fs.readLine());
        System.out.println(fs.readLine());//?
        fs.close();

    }
}

class J3write{
    public static void main(String[] args) throws Exception {
        BufferedWriter fs = new BufferedWriter(
                new FileWriter("_0905/src/j06bufferd/2.txt",true)
        );
        fs.write("hello");
        fs.write("孙悟空");
        fs.newLine();
        fs.write("白骨精666");
//        fs.flush();
        fs.close();
    }
}
